import {request} from './request.js' //导入封装好的js文件
 
 /*登录接口*/
export function Login(data){
  return request({
    url:'/login',
    method:'post',
    data:data
  })
}

// 根据学校代码查id
export function SchoolIdBySchoolNo(data){
  return request({
    url:'/school/getSchoolIdBySchoolNo',
    method:'post',
	data:data
  })
}
/*----------------------------商品接口-----------------------------*/
// 根据学校id查询商品
export function queryCommodityBySid(data){
  return request({
    url:'/commodity/queryCommodityBySid',
    method:'post',
	data:data
  })
}
// 查询商品详情
export function queryCommodityByCid(data){
  return request({
    url:'/commodity/queryCommodityByCid',
    method:'post',
	data
  })
}
/*----------------------------订单接口-----------------------------*/
/*查询订单列表*/
export function queryPageOrderByOpenid(data){
  return request({
    url:'/order/queryPageOrderByOpenid',
    method:'post',
	data:data
  })
}
// 订单详情
export function orderDetailByOrderId(id){
  return request({
    url:'/order/queryOrderDetailByOrderId/'+id,
    method:'get',
  })
}

/*----------------------------购物车接口-----------------------------*/
// 查询购物车
export function queryShoppingCartByOpenID(data){
  return request({
    url:'/order/queryShoppingCartByOpenID',
    method:'post',
	data
  })
}
// 修改数量
export function modifyShoppingCart(data){
  return request({
    url:'/order/modifyShoppingCart',
    method:'post',
	data
  })
}
// 删除购物车商品
export function removeShoppingCart(data){
  return request({
    url:'/order/removeShoppingCart',
    method:'post',
	data
  })
}
/*查询结算界面商品*/
export function queryBalanceByScid(data){
  return request({
    url:'/order/queryBalanceByScid',
    method:'post',
	data
  })
}
// 创建订单
export function savaOrderInfo(data){
  return request({
    url:'/order/savaOrderInfo',
    method:'post',
	data
  })
}
// 添加进购物车
export function saveShoppingCart(data){
  return request({
    url:'/order/saveShoppingCart',
    method:'post',
	data
  })
}
//修改商品的学生和尺寸
export function updateShoppingCart(data){
  return request({
    url:'/order/updateShoppingCart',
    method:'post',
	data
  })
}
// 查询学生和商品尺寸
export function queryStudentSpecifications(scid){
  return request({
    url:'/order/queryStudentSpecifications/' + scid,
    method:'get',
  })
}
/*--------------------------收货地址接口-------------------------------*/
/*查询收货地址*/
export function addrList(data){
  return request({
    url:'/addr/addrList',
    method:'post',
	data
  })
}
/*删除收货地址**/
export function delAddr(id){
  return request({
    url:'/addr/delAddr/'+id,
    method:'delete',
  })
}
/*根据收货地址id查询收货地址*/
export function getAddrById(id){
  return request({
    url:'/addr/getAddrById/'+id,
    method:'get',
  })
}
/*新增收货地址*/
export function saveAddr(data){
  return request({
    url:'/addr/saveAddr',
    method:'post',
	data
  })
}
/*修改收货地址*/
export function updateAddr(data){
  return request({
    url:'/addr/updateAddr',
    method:'post',
	data
  })
}
/*修改默认收货地址*/
export function updateDefaultAddr(data){
  return request({
    url:'/addr/updateDefaultAddr',
    method:'post',
	data
  })
}
/*--------------------------学生接口-------------------------------*/
/*查询学生*/
export function queryStudentByOpenid(data){
  return request({
    url:'/student/queryStudentByOpenid',
    method:'post',
	data
  })
}
/*查询单个学生详细信息*/
export function queryStudentBySid(sid){
  return request({
    url:'/student/queryStudentBySid/'+sid,
    method:'get',
  })
}
/*新增学生*/
export function saveStudent(data){
  return request({
    url:'/student/saveStudent',
    method:'post',
	data
  })
}
/*修改学生*/
export function modifyStudent(data){
  return request({
    url:'/student/modifyStudent',
    method:'post',
	data
  })
}
/**/
//我的界面显示订单数量
export function myOrderStatusCount(data){
  return request({
    url:'/order/myOrderStatusCount',
    method:'post',
	data
  })
}
/**----------------------------添加退款记录*/
export function savaRefundRecord(data){
  return request({
    url:'/order/savaRefundRecord',
    method:'post',
	data
  })
}
/*重新申请*/
export function reapplyRefundRecordByRefundId(data){
  return request({
    url:'/order/reapplyRefundRecordByRefundId',
    method:'post',
	data
  })
}
/*售后详情*/
export function queryRefundRecordByID(refundId){
  return request({
    url:'/order/queryRefundRecordByID/'+refundId,
    method:'get',
  })
}
/*售后订单列表*/
export function queryPageRefundRecord(data){
  return request({
    url:'/order/queryPageRefundRecord',
    method:'post',
	data
  })
}
/*添加物流单号*/
export function addLogisticsNo(data){
  return request({
    url:'/order/addLogisticsNo',
    method:'post',
	data
  })
}

/*立即购买*/
export function orderbuy(data){
  return request({
    url:'/order/buy',
    method:'post',
	data
  })
}
/*立即购买结算*/
export function orderbuyBalance(data){
  return request({
    url:'/order/buyBalance',
    method:'post',
	data
  })
}
/*更新物流信息*/
export function queryLogisticsNo(logisticsNo){
  return request({
    url:'/tong_anna/queryLogisticsNo/' + logisticsNo,
    method:'get',
  })
}

/*订单状态改变*/
export function orderConfirm(data){
  return request({
    url:'/order/orderConfirm',
    method:'post',
	data
  })
}
/*查询同意公告*/
export function getTips(){
  return request({
    url:'/tips/getTips',
    method:'get'
  })
}
/*取消订单*/
export function closeOrderInfo(data){
  return request({
    url:'/order/closeOrderInfo',
   method:'post',
   data
  })
}
